/*
 * @Author: li bo
 * @Date: 2025/07/09 18:07:51
 * @LastEditors: li bo
 * @Description: "歌曲流派模型"
 */
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("genre", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            comment: '唯一标识',
            defaultValue: Sequelize.UUIDV4,
        },
        name: {
            type: Sequelize.STRING(50),
            allowNull: false,
            unique: true,
            comment: '流派名称',
        },
        description: {
            type: Sequelize.TEXT,
            comment: '流派描述'
        }
    }, {
        tableName: 'genre',
        comment: '音乐流派表',
        indexes: [
            {
                unique: true, // 唯一索引
                fields: ['name']
            }
        ]
    })
}